import moment from 'moment';
export default {
    column: [
        {
            label: "维修分类",
            prop: "fix_category_info",
            showtooltip: true,
            minWidth: "150"
        },
        {
            label: "问题描述",
            prop: "remark",
            type: 0,
            showtooltip: true,
            minWidth: "200"
        },
        {
            label: "报修地址",
            prop: "user_address_info",
            type: 0,
            showtooltip: true,
            minWidth: "180"
        },
        {
            label: "用户名",
            prop: "username",
            type: 0,
        },
        {
            label: "手机号",
            prop: "mobile",
            type: 0,
            width:130
        },
        {
            label: "处理人",
            prop: "participant",
            type: 0,
            width: "160",
        },
        {
            label: "处理时长",
            prop: "processtime",
            type: 0,
            width: "160",
            formatter:(row)=>{
                    var x = row.processtime
                    var tempTime = moment.duration(x * 1000);
                    if (tempTime.days() > 0) {
                        return tempTime.days() + "天" + tempTime.hours() + "时" + tempTime.minutes() + "分";
                    } else if (tempTime.hours() > 0) {
                        return  tempTime.hours() + "时" + tempTime.minutes() + "分";
                    } else if (tempTime.minutes() > 0) {
                        return  tempTime.minutes() + "分钟";
                    }
            }
        },
        {
            label: "申请日期",
            prop: "gmt_created",
            type: 0,
            width: "160",
        },
        {
            label: "状态",
            prop: "is_draft",
            formatter:(row)=>{
                if(row.is_draft==1) {
                    return "待处理"
                }else if(row.is_draft==4){
                    return "待确认"
                }else if(row.is_draft==6){
                    return "待维修"
                }else if(row.is_draft==7){
                    return "已维修"
                }else if(row.is_draft==8){
                    return "已完成"
                }else if(row.is_draft==9){
                    return "已评价"
                }else if(row.is_draft==0){
                    return "已取消"
                }else {
                    return ""
                }
            }
        },
    ]
}
